//
//  DYCLoginRegisterView.m
//  DYCBaisi
//
//  Created by ChaoMac on 17/7/11.
//  Copyright © 2017年 Yachao. All rights reserved.
//

#import "DYCLoginRegisterView.h"


@interface DYCLoginRegisterView ()

@property (weak, nonatomic) IBOutlet UIButton *loginRegisterButton;


@end

@implementation DYCLoginRegisterView

+ (instancetype)loginView{
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] firstObject];
}

+ (instancetype)registerView{
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
}

- (void)awakeFromNib{
    [super awakeFromNib];

    UIImage *image = _loginRegisterButton.currentBackgroundImage;
    image = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
    
    // 让按钮背景图片不要被拉伸
    [_loginRegisterButton setBackgroundImage:image forState:UIControlStateNormal];
}

@end
